import { Image, StyleSheet, Text, Pressable, View } from 'react-native';
import { Button, Layout } from '@ui-kitten/components';
import { Link, useRouter } from 'expo-router';
import TopNavigation from '@/components/Navigation'
export default function ChooseIdentitycreen() {
  const router = useRouter()
  const arr = [{
    text: '学生',
    key: 'student'
  },
  {
    text: '家长',
    key: 'parent'
  }]
  const handleClickIndentity = (el) => {
    router.push({
      pathname: '/regist',
      params: {
        type: el.key
      }
    })
  }
  return (
    <>
      <TopNavigation title='选择身份'></TopNavigation>
      <Layout style={{ flexDirection: 'column', alignItems: 'center', height: '100%' }}>
        {
          arr.map((el, index) =>
            <Layout key={index} style={{ flexDirection: 'column', justifyContent: 'center', alignItems: 'center', marginTop: 120 }}>
              <Pressable onPress={() => handleClickIndentity(el)}>
                <Image style={{ width: 112, height: 112, borderRadius: 112, backgroundColor: '#F6F8FA', marginBottom: 10 }}></Image>
              </Pressable>
              <Text onPress={() => handleClickIndentity(el)} style={{ fontSize: 18 }}>{el.text}</Text>
            </Layout>
          )
        }
      </Layout>
    </>
  )
}